
#ifndef AFTERMATH_ALGEBRA_ELEMENTWISE_HPP_INCLUDED
#define AFTERMATH_ALGEBRA_ELEMENTWISE_HPP_INCLUDED

#include <cstddef>

namespace aftermath
{
    namespace algebra
    {
        struct elementwise
        {
            //template <typename T>
            //static T subtract(T x, const T&& y)
            //{
            //    for (std::size_t i = 0U; i < x.size(); i++) x[i] -= y[i];
            //    return x;
            //}

            template <typename T>
            static void subtract_assign(T& source, const T&& other)
            {
                for (std::size_t i = 0U; i < source.size(); i++) source[i] -= other[i];
            }

            template <typename T>
            static void add_assign(T& source, const T&& other)
            {
                for (std::size_t i = 0U; i < source.size(); i++) source[i] += other[i];
            }
        };
    }
}

#endif // AFTERMATH_ALGEBRA_ELEMENTWISE_HPP_INCLUDED
